/*    */ package com.zimbra.cs.index.query;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.cs.index.DBQueryOperation;
/*    */ import com.zimbra.cs.index.QueryOperation;
/*    */ import com.zimbra.cs.mailbox.MailServiceException;
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.mailbox.Tag;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class TagQuery
/*    */   extends Query
/*    */ {
/*    */   private final String name;
/*    */   
/*    */   public TagQuery(String name, boolean bool)
/*    */   {
/* 37 */     this.name = name;
/* 38 */     setBool(bool);
/*    */   }
/*    */   
/*    */   public boolean hasTextOperation()
/*    */   {
/* 43 */     return false;
/*    */   }
/*    */   
/*    */   public QueryOperation compile(Mailbox mbox, boolean bool) throws ServiceException
/*    */   {
/* 48 */     DBQueryOperation op = new DBQueryOperation();
/*    */     try {
/* 50 */       op.addTag(mbox.getTagByName(null, this.name), evalBool(bool));
/*    */     } catch (MailServiceException mse) {
/* 52 */       if ("mail.NO_SUCH_TAG".equals(mse.getCode()))
/*    */       {
/*    */ 
/* 55 */         op.addTag(Tag.createPseudoRemoteTag(mbox, this.name), evalBool(bool));
/*    */       } else {
/* 57 */         throw mse;
/*    */       }
/*    */     }
/* 60 */     return op;
/*    */   }
/*    */   
/*    */   public void dump(StringBuilder out)
/*    */   {
/* 65 */     out.append("TAG:");
/* 66 */     out.append(this.name);
/*    */   }
/*    */   
/*    */   public void sanitizedDump(StringBuilder out)
/*    */   {
/* 71 */     out.append("TAG:");
/* 72 */     out.append("$TAG");
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/index/query/TagQuery.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */